home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / DB_CLIPP / 0769B.ZIP / DB3UTIL.DOC < prev    next >
Text File  |  1987-05-26  |  19KB  |  449 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                              d B 3 U T I L  v 1.61
  7.  
  8.            dBASE III FILE ANALYZER AND QUICKSILVER COMPILER UTILITY
  9.  
  10.                          All Rights Reserved 1986,1987
  11.  
  12.                                John Calvin Thames
  13.                                    PES, Inc.
  14.                            11440 Isaac Newton Square
  15.                                    Suite 209
  16.                             Reston, Virginia 22090
  17.                                  703/471-8383
  18.  
  19.  
  20.     COPYING, DISTRIBUTION, AND CAVEATS:
  21.  
  22.          dB3UTIL may be copied and distributed freely.  However, if you
  23.          distribute dB3UTIL on BBSes, CompuServe, the Source, GEnie, et al,
  24.          please include the following files as a set: 
  25.                                  dB3UTIL.EXE
  26.                                  dB3UTIL.DOC
  27.                                  dB3UTIL.NEW
  28.                                   DBU_QS.BAT
  29.          No fee other than a disk and handling charge (of up to $10) should 
  30.          be charged.
  31.  
  32.          I do not request nor do I expect to receive any payment from the 
  33.          distribution and use of dB3UTIL. Likewise I will not be responsible
  34.          for any damages caused by use, misuse, or inability to use dB3UTIL.
  35.  
  36.     DESCRIPTION:
  37.  
  38.          dB3UTIL is a utility program for dBase III programmers especially
  39.     those using WordTech's Quicksilver compiler.  The program provides seven
  40.     basic functions:
  41.  
  42.          1. Lists all nonduplicate program, format, procedure, database,
  43.             index, memory, and report form files called in a dBase system
  44.             tree beginning with the specified file and all subsequent
  45.             files called.  Also can report on a single file only.  Reports
  46.             any files which were called and could not be found.  Lists to
  47.             either the screen or a printer.
  48.  
  49.          2. Provides a detailed analysis for each program in the system tree
  50.             (or one program only) of each program, format, procedure,
  51.             database, index, memory, and report form file called by that
  52.             program.  Also lists each database used and each index file used
  53.             by that database, the key expressions for each index, and the 
  54.             structure for each database.  Reports on called files which could 
  55.             not be found.
  56.  
  57.          3. QSMAKE - Creates a list file for use with the Quicksilver compiler.
  58.             Includes files which have been changed since the last compile
  59.             date or a user specified date (a la UNIX MAKE).  Saves time by
  60.             eliminating the recompilation of files which have not changed.
  61.  
  62.  
  63.                                      - 1 -
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.          4. Allows a global find and replace of strings with or without a
  71.             query in one file or all files in a system tree.  For example
  72.             this allows a mass change of a variable name throughout the
  73.             entire system of programs called by a root program.
  74.  
  75.          5. Performs an automatic backup of modified files in a dBase
  76.             system to a specified drive and/or path.
  77.  
  78.          6. Executes the Quicksilver compiler, linker, and optimizer from
  79.             dB3UTIL.
  80.  
  81.          7. Encrypts and decrypts specified databases.  Encrypted databases
  82.             cannot be used by dBase.
  83.  
  84.          Typing dB3UTIL ? displays the help screen shown below.
  85.  
  86. ================================================================================
  87.  
  88. dB3UTIL v 1.61 Usage : dB3UTIL <filename> [db3util switch] [date]
  89.  
  90.         <filename> : root, main program, or parent dBASE file with extension
  91.  
  92.   [db3util switch] : -A, -C, -L, -R, and -RQ of the following cannot be used
  93.                      together on a command line
  94.            [blank] = List files to screen
  95.                 -A = Print analysis of files
  96.           -B<path> = Backup files to specified path
  97.                 -C = Create QUICKSILVER Compiler listfile
  98.          -D<drive> = Object-code files located on specified drive
  99.       -E<filename> = Encrypt/decrypt database <filename>
  100.                 -F = 1st character of filename dropped to form object-code file
  101.                 -L = List files to printer
  102.                 -O = Analyze <filename> only
  103.                 -Q = Execute QUICKSILVER Compiler with listfile
  104.  -R[<str1>:<str2>] = Find and replace (without query) <str1> with <str2>
  105. -RQ[<str1>:<str2>] = Find and replace (with query) <str1> with <str2>
  106.  
  107.             [date] : specifies file creation or change date (mm/dd/yyyy) for
  108.                      -C option.  [blank] defaults to last compile date.
  109.  
  110. ================================================================================
  111.  
  112.       <filename> = Identifies the program file on which the analysis begins.
  113.                    Usually this file will be the first file used when running a
  114.                    program.  Unless the -O option is selected, all subordinate
  115.                    files called by this program file will be analyzed.  The
  116.                    file extension (e.g. .PRG) must be included when specifying
  117.                    the file name.  A path can also be specified.  For example,
  118.                    dB3UTIL B:\ACCOUNT\INVOICE.PRG will change the active
  119.                    directory to B:\ACCOUNT.  At the conclusion of the program,
  120.                    control will be returned to the original directory.
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.                                      - 2 -
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134. <db3util switch> = This option switch selects the type of analysis to be 
  135.                    conducted.  The options -A, -C, -L, -R, and -RQ cannot
  136.                    be used together on the same command line.  If more than
  137.                    one is specified, the first option listed will be the
  138.                    command which is executed.
  139.  
  140.                    [blank] = If there are no options selected, the program
  141.                              default is to list to the screen all of the
  142.                              files by file type (program, format, database,
  143.                              etc.) found during the analysis.
  144.  
  145.                         -A = Prints to a printer an analysis of which files
  146.                              are used by each of the other files.  A list
  147.                              is also printed of each database and the index 
  148.                              file(s) used by that database, the key expression 
  149.                              of each index, and the structure of each database.
  150.                              Also listed are any files which are called and 
  151.                              cannot found in the active directory.
  152.  
  153.                   -B<path> = Performs an automatic backup of modified files
  154.                              in a dBase system identified by root file
  155.                              <filename> to a specified <path>.  The path may 
  156.                              be a disk drive and/or subdirectory.  The file is 
  157.                              copied to the target path if it does not exist 
  158.                              there or if it has been changed based on the file
  159.                              creation time and date.  The available disk space
  160.                              is obtained prior to each file copy.  If 
  161.                              insufficient space is available, the user is 
  162.                              prompted to insert a new disk or stop the backup
  163.                              process.  This option creates a disk file of all
  164.                              of the filenames which comprise the system whether
  165.                              the files have been modified or not.  The name
  166.                              of this file is formed from the root file
  167.                              <filename> (less its extension) plus the extension
  168.                              .@BU.  For example, the backup filename for a root
  169.                              file named TEST.PRG will be TEST.@BU.  If this
  170.                              filename is found in the root file directory, the 
  171.                              user is asked if this file should be used as it 
  172.                              currently exists.  If the answer is 'no', the file
  173.                              is erased and a new file is created.
  174.  
  175.                         -C = Creates a Quicksilver Compiler listfile.  This
  176.                              is an ASCII file which contains the names of the
  177.                              individual program or format files which are to
  178.                              be compiled.  This option is used in conjunction
  179.                              with the [date] specification.  If [date] is
  180.                              listed, all program files found during the
  181.                              dB3UTIL analysis which have file creation dates
  182.                              (as shown when listing a directory) on or after
  183.                              that [date] will be included in the listfile.  If
  184.                              no [date] is specified and a corresponding 
  185.                              object-code file exists (either in the active 
  186.                              directory or as indicated by the -D option), the
  187.                              date for each object-code file determines whether
  188.                              a file is included in the listfile.  If no [date]
  189.                              is specified and no corresponding object-code file
  190.  
  191.                                      - 3 -
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.                              is found, that file is included in the listfile.
  199.                              This option allows a recompilation only of files
  200.                              which have been changed since the last compilation.
  201.                              The listfile will be named <filename>.DBU where
  202.                              <filename> is the root file (less its extension)
  203.                              specified on the command line when dB3UTIL is 
  204.                              invoked.
  205.  
  206.                  -D<drive> = Identifies the <drive> location of existing object-
  207.                              code files.  This option is used in conjunction 
  208.                              with the -C option.
  209.  
  210.               -E<filename> = Encrypts and decrypts the database with the name
  211.                              <filename> where <filename> must include the 
  212.                              extension (e.g., .DBF) and may contain a full
  213.                              path name and the wildcard characters (? or *).
  214.                              Once encrypted the database cannot be used by 
  215.                              dBase until it has been decrypted.  The -E option
  216.                              determines whether the named database is already
  217.                              encrypted or not and performs the reversing
  218.                              procedure.  No encryption keys need to specified
  219.                              by the user.  This is the only dB3UTIL option 
  220.                              switch which may be used alone on the command line.
  221.                              For example, the command
  222.                                            dB3UTIL -e\test\*.dbf
  223.                              will encrypt or decrypt, as appropriate, all 
  224.                              database files in the directory TEST with the 
  225.                              extension of .DBF. If there are both encrypted
  226.                              and unencrypted databases which match the
  227.                              <filename>, the encrypted files will be decrypted
  228.                              and the unencrypted files will be encrypted.
  229.  
  230.                         -F = Indicates if the first letter of the file name was
  231.                              dropped to form the object-code file.  By default
  232.                              Quicksilver creates an object-code file by adding
  233.                              the "@" character to the beginning of the compiled
  234.                              filename.  If the filename is eight characters
  235.                              long, the last character is dropped to form the
  236.                              object-code name.  An option with Quicksilver is
  237.                              to drop the first rather than the last letter 
  238.                              when forming the object-code filename.  The
  239.                              dB3UTIL -C option needs to know how the name was
  240.                              formed when it looks for the file creation date.
  241.  
  242.                         -L = Performs the same function as using no options
  243.                              (see [blank] above) except the list of files are
  244.                              sent to a printer rather than the screen.
  245.  
  246.                         -O = Analyses only the single <filename>.  This option
  247.                              does not analyze the files called by <filename>.
  248.  
  249.                         -Q = Executes the Quicksilver compiler, linker, and
  250.                              optimizer from inside dB3UTIL.  Actually the
  251.                              batch file DBU_QS.BAT is executed which in turn
  252.                              executes Quicksilver.  The example batch file
  253.                              included with dB3UTIL is shown below.
  254.  
  255.                                      - 4 -
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.                              echo off
  263.                              cls
  264.                              rem invoke compiler using listfile passed as %1
  265.                              db3c ~%1
  266.                              rem invoke linker (for optimizer only) creating 
  267.                              rem .DBC filename passed as %2
  268.                              db3l -q %2
  269.                              rem invoke optimizer with DOS linker using .DBC 
  270.                              rem filename created with %2
  271.                              qs -l %2
  272.  
  273.                              This file may be customized by the user to include
  274.                              any of the Quicksilver options as needed.  It is
  275.                              important to maintain the name of the batch file
  276.                              as DBU_QS.BAT and to locate the file in the
  277.                              directory specified with the root file <filename>.
  278.                              It is equally important to understand the use of
  279.                              the replaceable parameters %1 and %2.  %1 is the
  280.                              name of the listfile and is passed to DBU_QS.BAT
  281.                              from dB3UTIL.  It must be preceded by the tilde
  282.                              (~) for Quicksilver to recognize it as a listfile.
  283.                              %2, also passed to DBU_QS.BAT from dB3UTIL, is the
  284.                              root file (less its extension) and is used by the
  285.                              Quicksilver linker to form the name of the .DBC
  286.                              file and by the optimizer to form the name of the
  287.                              optimized .EXE file.  
  288.  
  289.                              For example
  290.                                         dB3UTIL test.prg -c -q
  291.                              will create a listfile named TEST.DBU and then
  292.                              execute DBU_QS.BAT with the replaceable parameters
  293.                              %1 = TEST.DBU and %2 = TEST.  It should be noted
  294.                              that since the listfile contains only those files
  295.                              which were changed since the last compile, the
  296.                              batch file DBU_QS.BAT should be modified to include
  297.                              the necessary references to the location of the 
  298.                              remaining object-code files.
  299.  
  300.          -R[<str1>:<str2>] = Finds and replaces (without query) <str1> with
  301.                              <str2>.  This allows a global replacement of a 
  302.                              string with any other string.  If used without
  303.                              the -O option, <str1> will be replaced in the
  304.                              specified file and all called files without
  305.                              waiting for confirmation.  The square brackets
  306.                              must be used as delimiters so that leading and
  307.                              trailing spaces can be included.  For example,
  308.                              [FOR:THE] is not the same as [ FOR : THE ].  The
  309.                              first combination would find every usage of FOR
  310.                              (in the word FORMAT for instance) whereas the
  311.                              second combination would find only the unique word
  312.                              FOR.  The replacement string <str2> does not have
  313.                              to be the same length as <str1>.  The string
  314.                              "INTERNATIONAL BUSINESS MACHINES" could replace the
  315.                              string "IBM".  However line lengths in excess of
  316.                              255 characters could be created which may cause
  317.                              problems with some text editors.
  318.  
  319.                                      - 5 -
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.         -RQ[<str1>:<str2>] = Performs the same as the -R option except that
  327.                              a confirming query is presented prior to any
  328.                              string replacement.  For example the command
  329.                              -RQ[FOR:THE] will require following question
  330.                                      REPLACE FOR WITH THE? (Y/N)
  331.                              to be answered with a "Y" before a replacement
  332.                              takes place.  The program line containing the
  333.                              found <str1> will be displayed above the query.
  334.                              The -R and -RQ options can be used on any ASCII
  335.                              file which ends each line with a carriage return 
  336.                              and a line feed.
  337.  
  338.                     [date] = Specifies the last file change or creation date
  339.                              for use with the -C option.  See -C above.
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.                                      - 6 -
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.     NOTES:
  391.  
  392.     1. The <Esc> key will abort dB3UTIL during all operations (except during 
  393.        the execution of the Quicksilver compiler) and will close all open disk
  394.        files normally.
  395.  
  396.     KNOWN PROBLEMS:
  397.  
  398.     1. Currently the program will report file names referenced inside of 
  399.        TEXT...ENDTEXT blocks.  For example,
  400.  
  401.        TEXT
  402.        
  403.        use the cursor keys to move...
  404.  
  405.        ENDTEXT
  406.  
  407.        will cause dB3UTIL to report a database file named THE.
  408.  
  409.  
  410.     2. Macro substituted file names are ignored.
  411.  
  412.     ACKNOWLEDGEMENTS:
  413.  
  414.          Thomas Hanlin III for the excellent Advanced Function Library for
  415.       the BASIC Compiler - ADVBAS.LIB.
  416.  
  417.          Tim Conners (INFOLINK Sysop) for his helpful suggestions.
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.                                      - 7 -
  448.  
  449.